#include<iostream>
#include<csignal>
#include<unistd.h>

#include<string>

using namespace std;

void signalHandler(int signum){
	cout<<"stop ("<<signum<<").\n"<<endl;
	//exit(signum);
}

int main18(){
	signal(SIGINT,signalHandler);
	while(true){
		cout<<"going to sleep..."<<endl;

		sleep(2);
	}
	cin.get();
	cin.ignore();
	return 0;
}
